package com.taotao.manager.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.taotao.common.bean.EasyUIResult;
import com.taotao.manager.mapper.ContentMapper;
import com.taotao.pojo.TbContent;

@Service
public class ContentService extends BaseService<TbContent> {
	
	@Autowired
	private ContentMapper contentMapper;
	
	public EasyUIResult queryListBycategoryId(Long categoryId, Integer page, Integer rows) {
		PageHelper.startPage(page, rows);
		List<TbContent> contents = this.contentMapper.queryListBycategoryId(categoryId);
		PageInfo<TbContent> pageInfo = new PageInfo<TbContent>(contents);
		return new EasyUIResult(pageInfo.getTotal(), pageInfo.getList());
	}
}
